﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Quartz.Api.ServiceExtensions
{
    public static class CorsSetup
    {
        public static void AddCorsSetup(this IServiceCollection services) {
            services.AddCors(options =>
            {
                options.AddPolicy("_myAllowSpecificOrigins",
                                      builder =>
                                      {
                                          builder
                                          .SetIsOriginAllowed((host) => true)
                                          .AllowAnyMethod()
                                          .AllowAnyHeader()
                                          .AllowCredentials();
                                      });
            });
        }
    }
}
